package com.haima.sage.bigdata.api.service.impl;

import com.haima.sage.bigdata.api.dao.ApiRepository;
import com.haima.sage.bigdata.api.entity.api.Api;
import com.haima.sage.bigdata.api.service.ApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Optional;

@Service
public class ApiServiceImpl implements ApiService {
    private final ApiRepository apiRepository;

    @Autowired
    public ApiServiceImpl(ApiRepository apiRepository) {
        this.apiRepository = apiRepository;
    }

    @Transactional(readOnly = true)
    @Override
    public Optional<Api> findById(String id) {
        return this.apiRepository.findById(id);
    }
}
